<!DOCTYPE html>
<input type="submit" id="sub1"/>
<input type="submit" id="sub2"/>
<style>
#sub1:active {
	display: none;
}
#sub2:hover {
	display: none;
}
</style>
<script>
if (window.eventSender) {
    // Tests if the display style is applied and restored properly when display:none is set on active state
    var b1 = document.getElementById("sub1");
    var startX = b1.offsetLeft + b1.offsetWidth/2;
    var startY = b1.offsetTop + b1.offsetHeight/2;
    var endX = startX + b1.offsetWidth;
    var endY = startY + b1.offsetHeight;
    eventSender.dragMode = true;
    eventSender.mouseMoveTo(startX, startY);
    eventSender.mouseDown();
    eventSender.mouseMoveTo(endX, endY);
    eventSender.mouseUp();

    // Tests if the display style is applied and restored properly when display:none is set on hover state
    var b2 = document.getElementById("sub2");
    var x = b2.offsetLeft + b2.offsetWidth/2;
    var y = b2.offsetTop + b2.offsetHeight/2;
    eventSender.mouseMoveTo(x, y);
    eventSender.mouseMoveTo(x + b2.offsetWidth, y + b2.offsetHeight);
}
</script>
